<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>新增取消逾期征信</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div class="a">
        <form id="capOvdCancelLogForm">
            <div class="fieldset1 tabel_col tabel_col_1 clearFix">
                  <div class="fieldBox col_100">
                      <div class="label">支付表号</div>
                      <div class="field">
                          <input name="paySchNo" id="paySchNo" type="text" class="ui-textbox" value="">
                      </div>
                  </div>
                  <div class="fieldBox col_100">
                      <div class="label">期次（多期逗号分隔）</div>
                      <div class="field">
                          <input name="payPds" id="payPds" type="text" class="ui-textbox" value="">
                      </div>
                  </div>
            </div>
        </form>
    </div>

    <div id="btnsBox" class="btnsBox" style="text-align: center;">
        <span id="saveCapOvdCancelLogBtn" class="sq-button sq-button-round">保存</span>
    </div>
</div>
<script>
	var grid = null, menu = null;
	$(function () {
		$("#capOvdCancelLogForm").ligerForm();

		$("#saveCapOvdCancelLogBtn").click(function (event) {
			//$(document).trigger('click');
			var _repayTypCd = $("#paySchNo").val();
			alert(_repayTypCd)
			if( _repayTypCd == ''){
				$.ligerDialog.SQalert({content:'支付表号不可空', SQ_type: "warring"});
				return;
			}
			if( _repayTypCd == null){
				$.ligerDialog.SQalert({content:'支付表号不可空', SQ_type: "warring"});
				return;
			}
			var _repayTypCd = $("#payPds").val();
			if( _repayTypCd == ''){
				$.ligerDialog.SQalert({content:'期次不可空', SQ_type: "warring"});
				return;
			}
			var _repayTypCd = $("#payPds").val();
			if( _repayTypCd == null){
				$.ligerDialog.SQalert({content:'期次不可空', SQ_type: "warring"});
				return;
			}

			var form = liger.get("capOvdCancelLogForm");
			var formData = form.getData();

            $.ligerDialog.confirm(LogUtils.LOG_CMM_SUBMIT_CONFIRM_CONTENT_001, function (flag) {
                if (flag == false)return;
                var wait_dialog;
                $.ajax({
                    type: 'post',
                    dataType: 'json',
                    data: formData,
                    url: '<%=path%>/ovdcancel/capOvdCancelLog/add.do',
                    beforeSend: function () {
                        wait_dialog = $.ligerDialog.SQalert({
                            content: LogUtils.LOG_CMM_DATA_LOADING,
                            SQ_type: "waitting"
                        });
                    },
                    success: function (msg) {
                        wait_dialog.close();
                        if (msg.success == 1) {
                            top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                            parent.$("#clearBtn").click();
                            parent.$("#searchBtn").click();
                            frameElement.dialog.close();
                        } else {
                            $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                        }
                    }
                });
            });
		});
	});
	//格式化时间
	function renderDate(rowdata, index, value) {
		var dateStr = "";
		if (null != value) {
			var date = new Date(value);
			dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
		}
		return dateStr;
	}
</script>
</body>
</html>
